{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Viewing stuff in chemview is fairly easy. But since it deals only with visualization we will use another program (mdtraj) to pull data from the web. This is a protein."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import mdtraj as md\n",
    "traj = md.load_pdb('../tests/data/2M6K.pdb')\n",
    "print(traj)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Chemview provides a class MolecularViewer and helpers to let you easily display the protein using a cylinder and strand representation."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from chemview import MolecularViewer\n",
    "from chemview.contrib import topology_mdtraj\n",
    "\n",
    "mv = MolecularViewer(traj.xyz[0], topology_mdtraj(traj))\n",
    "# mv.cylinder_and_strand()\n",
    "mv.cartoon()\n",
    "mv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from chemview.export import display_static\n",
    "\n",
    "display_static(mv)"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [default]",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
